package xjh.him.common;

import android.os.Handler;
import android.widget.TextView;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

import xjh.him.adapter.ChatAdapter;
import xjh.him.adapter.FriendAdapter;
import xjh.him.adapter.MsgListAdapter;
import xjh.him.entity.User;
import xjh.him.netty.NettyClient;

public class SharedData {
    public static CustomFuture<Object> future = new CustomFuture<>();
    public static NettyClient client;

    // me
    public static User me;
    public static String token;

    // chat type
    public static final int CHAT_TYPE_SINGLE = 1;
    public static final int CHAT_TYPE_GROUP = 2;
    public static final String CHAT_TYPE_SINGLE_STR = "single";
    public static final String CHAT_TYPE_GROUP_STR = "group";

    // chat msg type
    public static final byte CHAT_MSG_TYPE_TEXT = 1;
    public static final byte CHAT_MSG_TYPE_IMAGE = 2;
    public static final byte CHAT_MSG_TYPE_FILE = 3;

    // apply state
    public static final int STATE_APPLY = 1;
    public static final int STATE_AGREE = 2;

    // request code
    public static final int REQ_CODE_USER_INFO = 1;
    public static final int REQ_CODE_CHAT = 2;
    public static final int REQ_CODE_CAMERA = 3;
    public static final int REQ_CODE_PICTURE = 4;
    public static final int REQ_CODE_HOME_MSG = 5;

    public static final int UPDATE_MSG_ITEM_MESSAGE = 1;
    public static final int UPDATE_CHAT_ITEM_MESSAGE = 2;
    public static Handler updateMsgItemHandler;
    public static Handler updateChatItemHandler;

    // result code
    public static final int RESULT_CODE_CHAT = 1;

    // adapter
    public static MsgListAdapter msgListAdapter;
    public static FriendAdapter friendAdapter;
    public static List<User> friendBeans;

    // view
    public static TextView countBubbleText;

    // Integer: chat_id
    public static final ConcurrentHashMap<Integer, ChatAdapter>
            CHAT_ADAPTER_MAP = new ConcurrentHashMap<>();
}
